import base64
with open('icon.ico', 'rb') as icon:
    icon_str = base64.b64encode(icon.read());
    print(icon_str)